﻿<ResourceDictionary 
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:c="clr-namespace:Sonce.Controls;assembly=Sonce.Controls">
  <Style x:Key="LoadingAnimationStyle" TargetType="c:LoadingAnimation">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="c:LoadingAnimation">
          <Grid x:Name="RootElement">
            <Border CornerRadius="2" BorderThickness="2" VerticalAlignment="Center" HorizontalAlignment="Center">
              <Canvas x:Name="LoadingAnimation" Width="32" Height="32" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Center" VerticalAlignment="Center">
                <Canvas.Resources>
                  <SolidColorBrush x:Key="ControlInnerBrush" Color="White" />
                  <Storyboard x:Key="Normal State">
                  </Storyboard>
                  <Storyboard x:Key="Loading State" RepeatBehavior="Forever">
                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="LoadingAnimationRotate" Storyboard.TargetProperty="Angle">
                      <SplineDoubleKeyFrame KeyTime="00:00:00.001" Value="0" />
                      <SplineDoubleKeyFrame KeyTime="00:00:00.100" Value="0" />
                      <SplineDoubleKeyFrame KeyTime="00:00:00.101" Value="45" />
                      <SplineDoubleKeyFrame KeyTime="00:00:00.200" Value="45" />
                      <SplineDoubleKeyFrame KeyTime="00:00:00.201" Value="90" />
                      <SplineDoubleKeyFrame KeyTime="00:00:00.300" Value="90" />
                      <SplineDoubleKeyFrame KeyTime="00:00:00.301" Value="135" />
                      <SplineDoubleKeyFrame KeyTime="00:00:00.400" Value="135" />
                      <SplineDoubleKeyFrame KeyTime="00:00:00.401" Value="180" />
                      <SplineDoubleKeyFrame KeyTime="00:00:00.500" Value="180" />
                      <SplineDoubleKeyFrame KeyTime="00:00:00.501" Value="225" />
                      <SplineDoubleKeyFrame KeyTime="00:00:00.600" Value="225" />
                      <SplineDoubleKeyFrame KeyTime="00:00:00.601" Value="270" />
                      <SplineDoubleKeyFrame KeyTime="00:00:00.700" Value="270" />
                      <SplineDoubleKeyFrame KeyTime="00:00:00.701" Value="315" />
                      <SplineDoubleKeyFrame KeyTime="00:00:00.800" Value="315" />
                    </DoubleAnimationUsingKeyFrames>
                  </Storyboard>
                </Canvas.Resources>
                <Canvas.RenderTransform>
                  <RotateTransform x:Name="LoadingAnimationRotate" Angle="0" />
                </Canvas.RenderTransform>
                <Ellipse Width="12" Height="12" Fill="{StaticResource ControlInnerBrush}" Canvas.Top="-6" Canvas.Left="10" />
                <Ellipse Width="3" Height="3" Fill="{StaticResource ControlInnerBrush}" Canvas.Top="3.25" Canvas.Left="25.75" />
                <Ellipse Width="3" Height="3" Fill="{StaticResource ControlInnerBrush}" Canvas.Top="14.50" Canvas.Left="30.50" />
                <Ellipse Width="3" Height="3" Fill="{StaticResource ControlInnerBrush}" Canvas.Top="25.75" Canvas.Left="25.75" />
                <Ellipse Width="4" Height="4" Fill="{StaticResource ControlInnerBrush}" Canvas.Top="30.00" Canvas.Left="14.00" />
                <Ellipse Width="5" Height="5" Fill="{StaticResource ControlInnerBrush}" Canvas.Top="24.75" Canvas.Left="2.25" />
                <Ellipse Width="8" Height="8" Fill="{StaticResource ControlInnerBrush}" Canvas.Top="12.00" Canvas.Left="-4.00" />
                <Ellipse Width="10" Height="10" Fill="{StaticResource ControlInnerBrush}" Canvas.Top="-0.25" Canvas.Left="-0.25" />
              </Canvas>
            </Border>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
</ResourceDictionary>
